import requests
from bs4 import BeautifulSoup
# res=requests.get(url="https://www.autohome.com.cn/news/")
# #通过原始内容decode
# # data=res.content.decode("gbk")
# # print(data)
# #通过requests内部decode
# res.encoding="gbk"
# data=res.text
# soup_object =BeautifulSoup(data,"html.parser")
# new_area_object=soup_object.find(name="div",attrs={"id":"auto-channel-lazyload-article"})
# # print(new_area_object)
# li_area_object=new_area_object.find_all(name="li")
# # print(li_area_object)
# # print(len(li_area_object))
# for li_object in li_area_object:
#     p_object=li_object.find(name="p")
#     if not p_object:
#         continue
#
#     print(p_object.text)
#     print("-"*100)
#
# res =requests.get(url="https://www.autohome.com.cn/news/")
# res.encoding="gbk"
# # print(res.text)
# soup_object=BeautifulSoup(res.text,"html.parser")
# # print(soup_object)
# editor_names_object=soup_object.find(name="ul",attrs={"id":"tagInfo"})
# # print(editor_names_object)
# editor_name_object=editor_names_object.find_all(name="li")
# for editor_name in editor_name_object:
#     name=editor_name.find(name="div",attrs={"class":"editorname"})
#     print(name.text)

